/*
*
==============================================================================
*  Name        : 
*  Part of     : Omen Game Engine - DirectX 10 Plugin
*  Description : 
*  Version     : 1.0
*
*  Copyright (c) 2013 Lauri Kortevaara.
* 
==============================================================================
*/

#ifndef _DirectX_10_ColorShader_H_
#define _DirectX_10_ColorShader_H_

//////////////
// INCLUDES //
//////////////
#include <d3d10.h>
#include <d3dx10math.h>
#include <fstream>
using namespace std;

namespace Omen {
////////////////////////////////////////////////////////////////////////////////
// Class name: DirectX_10_ColorShader
////////////////////////////////////////////////////////////////////////////////
class DirectX_10_ColorShader
{
public:
    DirectX_10_ColorShader();
    DirectX_10_ColorShader(const DirectX_10_ColorShader&);
    ~DirectX_10_ColorShader();

    //The functions here handle initializing and shutdown of the shader. The render function sets the shader parameters and then draws the prepared model vertices using the shader.

    bool Initialize( ID3D10Device*, HWND);
    void Shutdown();
    void Render( ID3D10Device*, int, D3DXMATRIX, D3DXMATRIX, D3DXMATRIX);

private:
    bool InitializeShader( ID3D10Device*, HWND, WCHAR*);
    void ShutdownShader();
    void OutputShaderErrorMessage( ID3D10Blob*, HWND, WCHAR*);

    void SetShaderParameters(D3DXMATRIX, D3DXMATRIX, D3DXMATRIX);
    void RenderShader( ID3D10Device*, int);

private:
    ID3D10Effect* m_effect;
    ID3D10EffectTechnique* m_technique;
    ID3D10InputLayout* m_layout;

    ID3D10EffectMatrixVariable* m_worldMatrixPtr;
    ID3D10EffectMatrixVariable* m_viewMatrixPtr;
    ID3D10EffectMatrixVariable* m_projectionMatrixPtr;
};

} // namespace Omen
#endif
